<?php
/**
 * ExtToolbarBase class file
 *
 * @author TrueSoftware B.V. (The Netherlands)
 * @link http://www.ext4yii.com
 * @copyright Copyright 2007-2010 TrueSoftwareB.V. all rights reserved.
 * @license http://www.ext4yii.com/license/
 *          EVALUATION VERSION - NOT FOR COMMERCIAL USE OR DISTRIBUTION.
 * @version 0.7.2
 */


class ExtToolbarBase extends ExtContainer
{
    private $_items_class_types = null;

    public function parseNode(ExtHTMLParserNode $node,
        ExtASTWalker $astwalker)
    {
        parent::parseNode($node, $astwalker);
        $this->parseItems($node, $astwalker);
    }

    private function parseItems($node,$astwalker)
    {
        $items = $node->findPropertyByName('toolbaritems');
        if(!is_null($items))
        {
            $titems = parent::parseNodeWidthTag($items,
                $astwalker,
                true,
                array('asobject'=>false),
                $this,
                $this->_items_class_types);
            $this->setArrayConfig('items', $titems);
        }
    }

    public function renderConfig($asobject=true)
    {
        if(!is_null($this->parent))
            $asobject = false;
        return parent::renderConfig($asobject);
    }

    public function createContainer(ExtHTMLParserNode $node)
    {
        if(!is_null($this->parent))
        {
            $node->shiftUp();
            return null;
        }
        else
        {
            parent::createContainer($node);
        }
    }
}
?>
